//
//  YYContentTableViewCell.m
//  ONE
//
//  Created by 杨毅 on 16/6/7.
//  Copyright © 2016年 GroupNine. All rights reserved.
//

#import "YYContentTableViewCell.h"

@implementation YYContentTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        
        /** 点赞 */
        self.praiseButton = [UIButton buttonWithType:UIButtonTypeCustom];
        self.praiseButton.titleLabel.text = @"913";
        self.praiseButton.titleLabel.font = [UIFont systemFontOfSize:13];
        [self.contentView addSubview:_praiseButton];
        
        /** 评论 */
        self.commentsButton = [UIButton buttonWithType:UIButtonTypeCustom];
        self.commentsButton.titleLabel.text = @"406";
        self.commentsButton.titleLabel.font = [UIFont systemFontOfSize:13];
        [self.contentView addSubview:_commentsButton];
        
        /** 分享 */
        self.shareButton = [UIButton buttonWithType:UIButtonTypeCustom];
        self.shareButton.titleLabel.text = @"804";
        self.shareButton.titleLabel.font = [UIFont systemFontOfSize:13];
        [self.contentView addSubview:_shareButton];
        
    }
    return self;
}

- (void)layoutSubviews
{
    /** 点赞 */
    self.praiseButton.frame = CGRectMake(0, 0, SCREEN_WIDTH / 3, 40);
    
    /** 评论 */
    self.commentsButton.frame = CGRectMake(self.praiseButton.bounds.origin.x + self.praiseButton.bounds.size.width, self.praiseButton.bounds.origin.y, self.praiseButton.bounds.size.width, self.praiseButton.bounds.size.height);
    
    /** 分享 */
    self.shareButton.frame = CGRectMake(self.commentsButton.bounds.origin.x + self.commentsButton.bounds.size.width, self.praiseButton.bounds.origin.y, self.praiseButton.bounds.size.width, self.praiseButton.bounds.size.height);
}

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
